<?php
global $dPconfig;
global $showEditCheckbox, $tasks, $priorities;
global $m, $a, $date, $min_view, $other_users, $showPinned, $showArcProjs, $showHoldProjs, $showDynTasks, $showLowTasks, $showEmptyDate, $user_id;
$perms =& $AppUI->acl();
$canDelete = $perms->checkModuleItem($m, 'delete');
if ($other_users) {
?>
<form name="form_buttons" method="post" action="index.php?<?php echo "m=$m&a=$a&date=$date";?>">
<table width="100%" border="0" cellpadding="7" cellspacing="0" class="infopanel">
<input type="hidden" name="show_form" value="1" />
<tr>
	<td width="50%">
	<?php
		echo $AppUI->_("Show Todo for:").'<select name="show_user_todo" onchange="document.form_buttons.submit()">';

		$usersql = "SELECT user_id, user_username, contact_first_name, contact_last_name
			FROM users, contacts
			WHERE user_contact = contact_id
			ORDER BY contact_last_name";

		if (($rows = db_loadList( $usersql, NULL ))) {
			foreach ($rows as $row) {
				if ( $user_id == $row["user_id"])
					echo "<OPTION VALUE='".$row["user_id"]."' SELECTED>".$row["contact_last_name"].', '.$row["contact_first_name"];
				else
					echo "<OPTION VALUE='".$row["user_id"]."'>".$row["contact_last_name"].', '.$row["contact_first_name"];
			}
		}
		echo '</select>';
	?>
	</td>
</tr>
</form>
</table>
<?php
}

$min_view = true;
	include $dPconfig['root_dir'] . '/modules/tasks/viewgantt.php';
?>
